<?php

namespace App\Console\Commands;

use Artisan;
use Illuminate\Console\Command;

class MakeAdminResourceCommand extends Command
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'admin:make-resource {name}';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = '生成后台一个资源的模型,迁移文件,和控制器';

    /**
     * Execute the console command.
     *
     * @return mixed
     */
    public function handle()
    {
        $name = $this->argument('name');

        $this->call('admin:make-model', [
            'name' => $name,
        ]);

        $this->call('admin:make-controller', [
            'name' => $name,
        ]);
    }
}
